<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /*1.第一种方式是利用vw来实现*/
    .square{
      width: 10%;
      height: 10vw;
      background:tomato;
    }
  </style>
</head>
<body>
  <div class="square"></div>
</body>
</html>